package com.naiterui.ehp.bs.patient.vo.patient;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.naiterui.ehp.bp.domain.Patient;
import com.naiterui.ehp.bs.patient.utils.StringUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 患者信息vo
 *
 * @version 2015年6月19日 上午11:58:59 by Amber
 * @Description 用于记录前端显示需要信息
 */
@ApiModel(value = "PatientVO", description = "患者基础信息VO")
public class PatientVO implements Serializable {
    /**
     * <简短描述>
     */
    private static final long serialVersionUID = -8999070503868464678L;

    /**
     * 唯一标识
     */
    @ApiModelProperty(value = "唯一标识")
    private Long patientId;

    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名")
    private String name;

    /**
     * 微信openId
     */
    @ApiModelProperty(value = "微信openId")
    private String openId;

    /**
     * 微信unionId
     */
    @ApiModelProperty(value = "微信unionId")
    private String unionId;

    /**
     * 性别
     */
    @ApiModelProperty(value = "性别")
    private Integer gender;
    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄")
    private String age;

    /**
     * 城市id(默认选中的)
     */
    @ApiModelProperty(value = "城市id(默认选中的)")
    private Integer cityId;

    /**
     * 省份ID
     */
    @ApiModelProperty(value = "省份ID")
    private Integer provinceId;
    /**
     * 城市ID
     */
    @ApiModelProperty(value = "城市ID")
    private Integer cityTempId;
    /**
     * 县ID
     */
    @ApiModelProperty(value = "县ID")
    private Integer countyId;
    /**
     * 省份名称
     */
    @ApiModelProperty(value = "省份名称")
    private String provinceName;
    /**
     * 城市名称
     */
    @ApiModelProperty(value = "城市名称")
    private String cityTempName;
    /**
     * 县名称
     */
    @ApiModelProperty(value = "县名称")
    private String countyName;
    /**
     * 电话
     */
    @ApiModelProperty(value = "电话")
    private String phone;
    /**
     * 身高
     */
    @ApiModelProperty(value = "身高")
    private Integer height;
    /**
     * 体重
     */
    @ApiModelProperty(value = "体重")
    private Integer weight;
    /**
     * 患者认证状态
     */
    @ApiModelProperty(value = "患者认证状态")
    private Integer status;

    /**
     * 注册时间
     */
    @ApiModelProperty(value = "注册时间")
    private Date createAt;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称")
    private String nickName;

    /**
     * 是否老用户
     */
    @ApiModelProperty(value = "是否老用户")
    private Boolean old;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    private String photo;

    /**
     * 密钥（命名选择是为了区分b2c接口密钥sign）
     */
    @ApiModelProperty(value = "密钥（命名选择是为了区分b2c接口密钥sign）")
    private String unionKey = "Serwkfjrewkjvlwe3483ddf";

    /**
     * 城市名
     */
    @ApiModelProperty(value = "城市名")
    private String city;

    /**
     * 是否可以咨询。完善基本资料后才可咨询
     */
    @ApiModelProperty(value = "是否可以咨询。完善基本资料后才可咨询")
    private Boolean canTalk;

    /**
     * 私人医生数量
     */
    @ApiModelProperty(value = "私人医生数量")
    private String personalNum;

    /**
     * 唯一私人医生id
     */
    @ApiModelProperty(value = "唯一私人医生id")
    @JsonInclude(Include.NON_NULL)
    private String defautDr;

    /**
     * <是否有私人医生>
     */
    @ApiModelProperty(value = "是否有私人医生")
    private Boolean havePersonal;

    /**
     * <患者所属科室－－推广医生所在科室>
     */
    @ApiModelProperty(value = "患者所属科室－－推广医生所在科室")
    private String department;

    /**
     * 首次绑定手机号 true：是；false：否 不用于json转换，业务判断使用：<code>firstBind</code>
     */
    @JsonIgnore
    private Boolean firstBind;

    /**
     * 患者app使用
     */
    @ApiModelProperty(value = "患者app使用")
    private String token;

    /**
     * 图文咨询收费(单位分)
     */
    @ApiModelProperty(value = "图文咨询收费(单位分)")
    private Integer consultCost;

    /**
     * 是否收费1收费，0免费
     */
    @ApiModelProperty(value = "是否收费1收费，0免费")
    private Integer consultPayType;
    /**
     * 身份证号：<code>idNo</code>
     */
    @ApiModelProperty(value = "身份证号")
    private String idNo;
    /**
     * 出生日期：<code>birthday</code>
     */
    @ApiModelProperty(value = "出生日期[PT-2.14.0新增]")
    private Long birthday;

    /**
     * 是否实名0未认证，1已认证
     */
    @ApiModelProperty(value = "是否实名0未认证，1已认证")
    private Integer realStatus;

    /**
     * 是否填写手机 0未填写，1已填写
     */
    @ApiModelProperty(value = "是否填写手机 0未填写，1已填写")
    private Integer phoneStatus;

    /**
     * 紧急联系人姓名
     */
    @ApiModelProperty(value = "紧急联系人姓名")
    private String contactName;

    /**
     * 紧急联系人电话
     */
    @ApiModelProperty(value = "紧急联系人电话")
    private String contactPhone;

    /**
     * 婚姻状态
     */
    @ApiModelProperty(value = "婚姻状态")
    private short maritalStatus;

    /**
     * 居住详细地址
     */
    @ApiModelProperty(value = "居住详细地址")
    private String address;

    @ApiModelProperty("用户Id")
    private String miniOpenId;

    @ApiModelProperty("用户不加密手机号")
    private String realPhone;

    public String getRealPhone() {
        return realPhone;
    }

    public void setRealPhone(String realPhone) {
        this.realPhone = realPhone;
    }

    public String getMiniOpenId() {
        return miniOpenId;
    }

    public void setMiniOpenId(String miniOpenId) {
        this.miniOpenId = miniOpenId;
    }

    public Boolean getFirstBind() {
        return this.firstBind;
    }

    public void setFirstBind(Boolean firstBind) {
        this.firstBind = firstBind;
    }

    public String getDepartment() {
        return this.department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public Boolean getHavePersonal() {
        return this.havePersonal;
    }

    public void setHavePersonal(Boolean havePersonal) {
        this.havePersonal = havePersonal;
    }

    public String getDefautDr() {
        return this.defautDr;
    }

    public void setDefautDr(String defautDr) {
        this.defautDr = defautDr;
    }

    public String getPersonalNum() {
        return this.personalNum;
    }

    public void setPersonalNum(String personalNum) {
        this.personalNum = personalNum;
    }

    public Boolean getCanTalk() {
        return this.canTalk;
    }

    public void setCanTalk(Boolean canTalk) {
        this.canTalk = canTalk;
    }

    public String getCity() {
        return this.city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public Long getPatientId() {
        return this.patientId;
    }

    public void setPatientId(Long patientId) {
        this.patientId = patientId;
    }

    public String getNickName() {
        return this.nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        if (StringUtils.isEmpty(name)) {
            name = "互联网医院患者";
        }
        this.name = name;
    }

    public String getOpenId() {
        return this.openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getUnionId() {
        return this.unionId;
    }

    public void setUnionId(String unionId) {
        this.unionId = unionId;
    }

    public Integer getGender() {
        return this.gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public String getAge() {
        return this.age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public Integer getCityId() {
        return this.cityId;
    }

    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    public String getPhone() {
        return StringUtil.securePhone(phone);
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Integer getHeight() {
        return this.height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public Integer getWeight() {
        return this.weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public Date getCreateAt() {
        return this.createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public String getUnionKey() {
        return this.unionKey;
    }

    public void setUnionKey(String unionKey) {
        this.unionKey = unionKey;
    }

    public Boolean getOld() {
        return this.old;
    }

    public void setOld(Boolean old) {
        this.old = old;
    }

    public String getPhoto() {
        return this.photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getToken() {
        return this.token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Integer getProvinceId() {
        return this.provinceId;
    }

    public void setProvinceId(Integer provinceId) {
        this.provinceId = provinceId;
    }

    public Integer getCountyId() {
        return this.countyId;
    }

    public void setCountyId(Integer countyId) {
        this.countyId = countyId;
    }

    public Integer getCityTempId() {
        return this.cityTempId;
    }

    public void setCityTempId(Integer cityTempId) {
        this.cityTempId = cityTempId;
    }

    public String getProvinceName() {
        return this.provinceName;
    }

    public void setProvinceName(String provinceName) {
        this.provinceName = provinceName;
    }

    public String getCityTempName() {
        return this.cityTempName;
    }

    public void setCityTempName(String cityTempName) {
        this.cityTempName = cityTempName;
    }

    public String getCountyName() {
        return this.countyName;
    }

    public void setCountyName(String countyName) {
        this.countyName = countyName;
    }

    public Integer getConsultCost() {
        return this.consultCost;
    }

    public void setConsultCost(Integer consultCost) {
        this.consultCost = consultCost;
    }

    public Integer getConsultPayType() {
        return this.consultPayType;
    }

    public void setConsultPayType(Integer consultPayType) {
        this.consultPayType = consultPayType;
    }

    public String getIdNo() {
        return StringUtil.secureIdcard(idNo);
    }

    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }

    public Long getBirthday() {
        return this.birthday;
    }

    public void setBirthday(Long birthday) {
        this.birthday = birthday;
    }

    public Integer getRealStatus() {
        return this.realStatus;
    }

    public void setRealStatus(Integer realStatus) {
        this.realStatus = realStatus;
    }

    public Integer getPhoneStatus() {
        return this.phoneStatus;
    }

    public void setPhoneStatus(Integer phoneStatus) {
        this.phoneStatus = phoneStatus;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public short getMaritalStatus() {
        return maritalStatus;
    }

    public void setMaritalStatus(short maritalStatus) {
        this.maritalStatus = maritalStatus;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    /**
     * 获取患者性别
     * Patient.getGenderStr()
     *
     * @return
     *
     * @Date 2016年6月21日
     * @since 2.5.0
     */
    @Transient
    public String getGenderStr() {
        if (null == this.gender) {
            return "未知";
        }
        String genderStr;
        switch (this.gender) {
            case Patient.GENDER_FEMALE:
                genderStr = "女";
                break;
            case Patient.GENDER_MALE:
                genderStr = "男";
                break;
            case Patient.GENDER_UNKNOWN:
                genderStr = "未知";
                break;
            default:
                genderStr = "未知";
                break;
        }
        return genderStr;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
